<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    var scope = "global";
    function fun(){
        console.log(scope);
        var a1 = "local";
        console.log(scope);
    }

    function fun2(){
        console.log(scope);
        var scope = "local";
        console.log(scope);
    }

    function fun3(){
        console.log(scope);
        var scope = "local";
        console.log(scope);
    }
fun();


    try{
        fun33();








    }catch(error){
        console.info(error);
    }

    function fun1(){
    　　var n=999;
    　　function fun2(){
    　　　　alert(n);    // 输出999
    　　}
    return fun2;
    }


var a = fun1();
</script>
<body>

</body>
</html>